package com.kaishengit.service;

import java.util.List;

import com.kaishengit.dao.FileTypeDao;
import com.kaishengit.entity.FileType;
import com.kaishengit.entity.UserProject;
import com.kaishengit.util.DateUtil;
import com.kaishengit.util.PkUtil;

public class FileTypeService {
	FileTypeDao filetypedao=new FileTypeDao();
	public  List<FileType> findByProjectId(String ProjectId){
		return filetypedao.findByProjectId(ProjectId);
	}

	public FileType findById(String ProjectId) {
		return filetypedao.findById(ProjectId);	
	}
	
	public void Del(String id){
		filetypedao.Del(id);
		
		
	}
public void save(String name, UserProject userProject) {
	    FileType ft=new FileType();
		ft.setId(PkUtil.getId());
		ft.setName(name);
		ft.setCreatetime(DateUtil.getNowDateTime());
		ft.setUser(userProject.getUser());
		ft.setUserid(userProject.getUser().getId());
		ft.setProject(userProject.getProject());
		ft.setProjectid(userProject.getProject().getId());

			filetypedao.save(ft);
	}
	

}
